/**
 * 
 */
package com.jeecms.wicool.manager.distribution.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.jeecms.common.page.Pagination;
import com.jeecms.wicool.dao.distribution.DistributionUserDao;
import com.jeecms.wicool.entity.distribution.DistributionUser;
import com.jeecms.wicool.manager.distribution.DistributionUserMng;

/**
 * @author Administrator
 *
 */
public class DistributionUserMngImpl implements
		DistributionUserMng {

	@Autowired
	private DistributionUserDao distributionUserDao;
	
	@Override
	public Pagination getPage(String name, String mobile, int pageNo,
			int pageSize) {
		return distributionUserDao.getPage(name, mobile, pageNo, pageSize);
	}

	@Override
	public DistributionUser findById(Integer id) {
		return distributionUserDao.findById(id);
	}

	@Override
	public DistributionUser save(DistributionUser obj) {
		return distributionUserDao.save(obj);
	}

	@Override
	public DistributionUser deleteById(Integer id) {
		return distributionUserDao.deleteById(id);
	}

	@Override
	public List<DistributionUser> deleteByIds(Integer[] ids) {
		return distributionUserDao.deleteByIds(ids);
	}

	@Override
	public DistributionUser update(DistributionUser obj) {
		DistributionUser db = distributionUserDao.findById(obj.getId());
		db.setName(obj.getName());
		db.setMobile(obj.getMobile());
		db.setPassword(obj.getPassword());
		return distributionUserDao.update(db);
	}

	@Override
	public List<DistributionUser> getAll() {
		return distributionUserDao.getAll();
	}

}
